<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title>vue局部组件</title>
</head>
<body>
<div id="app">
    <login></login>
</div>
</body>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    //局部组件登录模板声明
    let login = {
        template:'<div><h2>用户登录</h2></div>'
    }
    const app = new Vue({
        el: "#app",
        data: {},
        methods: {},
        //注册局部组件
        component:{
            //局部组件注册名
            'login':login
        },
    });
</script>
</html>
